@extends('admin')

@section('content')

    <p class="mb10">
        <a href="{{url('admin/job/update')}}" class="btn J_dialog" title="发布工作"><span class="add"></span>发布工作</a>
    </p>

    <div class="h_a">搜索</div>
    <div class="search_type cc mb10">
        <form action="{{url('admin/job')}}" method="get" class="search_form">
            <label for="search_title">雇主名称：</label><input type="text" name="own_name" value="{{$own_name}}" id="search_title"
                                                        class="input length_2 mr10"/>
            <button type="submit" class="btn">提交查询</button>
        </form>

    </div>

    <div class="table_list">
        <div id="data_list">
            <table class="items">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>户主</th>
                    <th>联系方式</th>
                    <th>岗位名称</th>
                    <th>工作薪资</th>
                    <th>地址</th>
                    <th>发布时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                @foreach ($list as $item)
                    <tr>
                        <td>{{$item->id}}</td>
                        <td>{{$item->own_name }}</td>
                        <td>{{$item->own_tel }}</td>
                        <td>{{$item->post}}</td>
                        <td>￥{{sprintf("%.2f", $item->price)}}</td>
                        <td>
                            {{json_decode($item->address,true)['s_province'].json_decode($item->address,true)['s_city'].json_decode($item->address,true)['s_county'].json_decode($item->address,true)['detial']}}
                        </td>
                        <td>{{$item->created_at}}</td>
                        <td>
                            <a href="{{url('admin/job/update/'.$item->id)}}" title="编辑 {{$item->name}}"
                               class="mr10 J_dialog">[编辑]</a>
                            <a href="{{url('admin/job/delete/'.$item->id)}}" class="mr10 J_ajax_del">[删除]</a>
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>

        <div class="summary">
            共有 {{$list->total()}} 条数据
        </div>
        @if ($list->hasPages())
            <div class="pager">
                {!! $list->appends($appends)->render() !!}
            </div>
        @endif
    </div>
@stop